import aiofiles
import asyncio

async def read_file():
    async with aiofiles.open("../resources/demo.txt", "r", encoding="utf-8") as f:
        # async for line in f:    # 异步迭代
        #     print(line.strip())
        contents = await f.read()
        print(contents)

asyncio.run(read_file())